--3 de 3
--unos códigos que hice por ocio... ahi están para quien le interese
--usar como fondo de bganimation
--(Screen[name] Background/default.lua)
local t = Def.ActorFrame {
	--InitCommand=cmd(zbuffer,true)
}

local oldx
local oldy
local cont = false

for i=0,100 do
t[#t+1] = LoadActor("_bright")..{
	InitCommand=cmd(playcommand,"Loop");
	LoopCommand=function(self)
		self:x(SCREEN_CENTER_X);
		self:y(SCREEN_CENTER_Y);
		self:diffusealpha(1);
		self:zoom(0);
		--self:z(0);
		
		local fSec = clamp( math.random(), .5, 2) * 2
		
		self:accelerate(fSec);
		
		local x = math.random(0,SCREEN_WIDTH)
		local y = math.random(0,SCREEN_HEIGHT)
		--no repitas tanto el mismo random porfas
		while cont do
			if (oldx == x) or (oldy == y) or (oldfSec == fSec) then
				x = math.random(0,SCREEN_WIDTH)
				y = math.random(0,SCREEN_HEIGHT)
				fSec = clamp( math.random(), .5, 2) * 2
				cont = false
			else
				cont = true
			end
		end
		
		self:x(x);
		self:y(y);
		self:diffusealpha(0);
		self:zoom(1);
		--self:z(1);
		
		oldx = x
		oldy = y
		oldfSec = fSec
		
		self:sleep(0.1);
		self:queuecommand("Loop");
	end;
}
end

return t